package edu.ycxy.poetry.mapper;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import edu.ycxy.poetry.entity.FanYi;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @Author @xin
 * @createDate 2022/3/8
 * @Description
 */
@Repository
public interface FanYiMapper extends BaseMapper<FanYi> {

    //根据古诗的id,查询翻译的具体内容, 条件为 gid
    @Select("select * from vab_fanyi where gid=#{gid}")
    List<FanYi> selectListToFanYi(Integer gid);

    @Insert("insert into vab_fanyi(title,info,biaoti,gid) values (#{title},#{info},#{biaoti},(select id from vab_writer where name=#{author}))")
    Integer insertFanYi(String title,String info,String biaoti,String author);
}
